SET(EXPR_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(EXPR_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "amd64")
	SET(EXPR_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
	SET(EXPR_CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
ENDIF()

ExternalProject_Add( EXPRPARSE
	URL ${CMAKE_CURRENT_SOURCE_DIR}/exprparse-e9651bf4eae0.zip
	DOWNLOAD_EXTRACT_TIMESTAMP TRUE
	SOURCE_SUBDIR "src"
	CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
		-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
		-DCMAKE_CXX_FLAGS=${EXPR_CMAKE_CXX_FLAGS}
		-DCMAKE_C_FLAGS=${EXPR_CMAKE_C_FLAGS}
		-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
		-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
		-DBUILD_TESTING=FALSE
)
ExternalProject_Get_Property( EXPRPARSE INSTALL_DIR )
SET( EXPRPARSE_INSTALL_DIR ${INSTALL_DIR} )
